const API = require('../../pages/api/index')
const { typeJson } = require('../../utils/typejson')
let prolist = wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist'))


Page({

  /**
   * 页面的初始数据
   */
  data: {
    pulldown:"",
    pullup:2,
    disable:true,
    prolist:wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist')),
    listConfig: [
        {
          label: '单元名称',
          prop: 'unitName'
        },
        {
          label: '填写时间',
          prop: 'createTime',
          
        }
      ],

      formConfig: [
        {
          label: '单元名称',
          prop: 'unitName',
         
      },
      {
        label: '单元类型',
        prop: 'unitTypeName',
    },
        {
          label:'上级单元类型',
          prop: 'unitId',
          type: 'dropDown',
          hidden: 'look',
          net: {
            url: '/app/riskUnit/getUpperType',
            method: 'post',
            key: 'unitTypeName',
            data:{
              mineId: true,
             
            },
            value: 'id'
          }
        },
       {
        label: '入井时间',
        prop: 'inWellTime',
        type:"dateTime",
       },

       
       
       {
        label: '出井时间',
        prop: 'outWellTime',
        type:"dateTime",
       },

        {
          label: "总结记录",
          prop: "remarks",
        },
    
        {
          label: '上传照片',
          prop: 'files',
          type: 'image'
        },


     
       
      
        ],
    
        
        net: {
       
            select: {
              url: `/app/riskUnit/getList`,
              method: 'post',
              data: {
                mineId: true,
                
              }
            },
            delete: {
              url: '/app/riskUnit/delete',
              method: 'post',
              data: {
                
              }
            },
            insert: {
              url: '/app/riskUnit/edit',
              method: 'post',
              data: {
                mineId:true,
              
               
              }
            },
            update: {
              url: '/app/riskUnit/edit',
              method: 'post',
              data: {
  
              }
            }
  
          
        },
        showCom:true
      },

     
  

  /**
   * 生命周期函数--监听页面加载
   */


  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },
  
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    console.log('5555');
    this.setData({
      showCom: false
    });
    this.setData({
      showCom: true
    });
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

   /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    wx.stopPullDownRefresh()
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    this.setData({
      pullup: this.data.pullup + 1
    })
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})